color chooser: Move buttons to template
authorMatthias Clasen <mclasen@redhat.com>
Wed, 9 Jul 2014 23:39:19 +0000 (19:39 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 9 Jul 2014 23:48:01 +0000 (19:48 -0400)
We can now use the new builder action support.

gtk/gtkcolorchooserdialog.c
gtk/resources/ui/gtkcolorchooserdialog.ui
gtk/resources/ui/gtkcolorchooserdialog.ui.h

index ce09783af6931205cabd8cf3af99c2f35031a7a2..176f9390729168f13c7da385e816b86da80f9240 100644 (file)
@@ -106,11 +106,6 @@ gtk_color_chooser_dialog_init (GtkColorChooserDialog *cc)
 
   gtk_widget_init_template (GTK_WIDGET (cc));
   gtk_dialog_set_use_header_bar_from_setting (GTK_DIALOG (cc));
-  gtk_dialog_add_buttons (GTK_DIALOG (cc),
-                          _("_Cancel"), GTK_RESPONSE_CANCEL,
-                          _("_Select"), GTK_RESPONSE_OK,
-                          NULL);
-  gtk_dialog_set_default_response (GTK_DIALOG (cc), GTK_RESPONSE_OK);
 
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_dialog_set_alternative_button_order (GTK_DIALOG (cc),
@@ -130,7 +125,8 @@ gtk_color_chooser_dialog_map (GtkWidget *widget)
    * even if it was showing the editor the last time it was used.
    */
   g_object_set (GTK_COLOR_CHOOSER_DIALOG (widget)->priv->chooser,
-                "show-editor", FALSE, NULL);
+                "show-editor", FALSE,
+                NULL);
 
   GTK_WIDGET_CLASS (gtk_color_chooser_dialog_parent_class)->map (widget);
 }
index 1d83b26c6e736fe6d6cdc184210de7de9976054c..1ad6d49a95efdd58b1bda991e180f11c560f4867 100644 (file)
         </child>
       </object>
     </child>
+    <child type="action">
+      <object class="GtkButton" id="cancel_button">
+        <property name="visible">True</property>
+        <property name="use_underline">True</property>
+        <property name="label" translatable="yes">_Cancel</property>
+      </object>
+    </child>
+    <child type="action">
+      <object class="GtkButton" id="ok_button">
+        <property name="visible">True</property>
+        <property name="label" translatable="yes">_Select</property>
+        <property name="use_underline">True</property>
+        <property name="can_default">True</property>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="cancel">cancel_button</action-widget>
+      <action-widget response="ok" default="true">ok_button</action-widget>
+    </action-widgets>
   </template>
 </interface>
index bc175710a672bfa0a54681fc09611f23c56315a1..af0ef0045a523bd208ec0a134ab4e565995a75bc 100644 (file)
@@ -1 +1,3 @@
 N_("Select a Color");
+N_("_Cancel");
+N_("_Select");